import { getLocale, Helmet } from 'umi';
import { withRouter } from 'dva/router';
import { ConfigProvider } from 'antd';
import { logoSrc } from '../assets/favicon.ico';
import React from 'react';
import LeftSide from '../components/leftSide';
import { ANT_DESIGN_LANGS } from '../helpers/antd';
import { Row, Col } from 'antd';
const style = { background: '#fff', borderRadius: '10px' };
export default function OpenPageLayout(props: any) {
  const { children } = props;

  return (
    <React.Fragment>
      <Helmet>
        <link rel="icon" href={logoSrc} type="image/x-icon" />
      </Helmet>
      <ConfigProvider locale={ANT_DESIGN_LANGS[getLocale()]}>
        <Row gutter={{ sm: 20 }}>
          <Col xs={{ span: 24, offset: 0 }} sm={{ span: 4 }}>
            <div style={style}>
              <LeftSide />
            </div>
          </Col>
          <Col xs={{ span: 24, offset: 0 }} sm={{ span: 15 }}>
            <div style={style}>{children}</div>
          </Col>
          <Col xs={{ span: 24, offset: 0 }} sm={{ span: 5 }}>
            <div style={style}>目录</div>
          </Col>
        </Row>
      </ConfigProvider>
    </React.Fragment>
  );
}
